<template>
	<view class="contain order-details" >
		<view class="padding-12">


			<view class="flex bg-color-w b-radius-5 margin-b12">
				<view class="flex flex-1">


					<view class="flex f-a-c f-j-c f-s-0 myicon myicon-address f44-size t-color-r padding-10"></view>
					<view class="flex f-c flex-1 f-j-c">
						<view class="flex f-a-c">
							<text class="flex f-a-c f-w-b f15-size margin-r12">{{order.receiveName}}</text>
							<text class="flex f-a-c f12-size t-color-9">{{order.receivePhone}}</text>
						</view>
						<view class="line1 margin-t4 f12-size">{{order.receiveAddress}}</view>
					</view>
				</view>
				<view class="padding-lr5">
					<view v-if="order.status == 2"	@click.stop="changeAddress()" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f12-size b-color-3 ">{{i18n['修改地址']}}</view>

							<!-- 	<view v-if="orderState[order.status].value == 'dfh'"
								@click.stop="changeAddress()" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f12-size b-color-3 ">{{i18n['修改地址']}}</view>
				 -->

				</view>
			</view>
			<!-- 拼团 -->
			<view v-if="order.type == 3" class="bg-color-w b-radius-5 padding-12 margin-b12">
				<view @click="go('/pages/order/group?id='+id)" class="flex  f-j-s">


					<!-- 1进行中 2成功 3失败 -->
					<text v-if="group.groupNum-group.haveGroupNum > 0 && group.status == 1" class="f-w-b t-color-3 margin-r4 ">{{i18n['差1人成团'] | i18n(group.groupNum-group.haveGroupNum)}}</text>
					<text v-else-if="group.status == 3" class="f-w-b t-color-3 margin-r4 ">{{i18n['拼团失败']}}</text>
					<text v-else class="f-w-b t-color-3 margin-r4 ">{{i18n['拼团成功']}}</text>
					<view class="flex f-a-c">
						<text class="t-color-y f12-size margin-r2">{{i18n['拼团详情']}}</text>
						<text class="flex f-a-c f-j-c van-icon van-icon-arrow t-color-9 f13-size margin-t2"></text>
					</view>
				</view>
				<view class="flex f-w">
					<view v-for="(item,index) in groupJoinList" :style="item.memberHeadImg | bgimg(300)+''" class="flex f-s-0 w-30 h-30 b-radius bg-img margin-t10 margin-r10"></view>
				</view>
			</view>

			<view class="bg-color-w b-radius-5 padding-12 margin-b12">
				<view @click="go('/pages/shops/shops?id='+order.shopId)" class="flex f-j-s margin-b16">
					<view class="flex f-a-c ">
						<text class="flex f-a-c van-icon van-icon-shop-o  margin-r6"></text>
						<text class="f-w-500 t-color-3 margin-r4 ">{{order.shopName}}</text>
						<text class="flex f-a-c van-icon van-icon-arrow t-color-9 "></text>
					</view>
				</view>
				<view class="margin-b10" v-for="(item,index) in goodsList">




					<view class="borRadius14">
						<!-- <orderGoods :orderInfo="item" :orderNo="orderNo" :cartInfo="item.orderInfoList" :jump="true"
							:orderData="orderInfo"></orderGoods> -->
					</view>

					<view @click="go('/pages/goods/detail?id='+item.goodsId)" class="flex">
						<view class="flex f-s-0 w-70 h-70 b-radius-5 bg-img  margin-r10" :style="item.goodsMainImg | bgimg(300)+''"></view>
						<view class="flex flex-1 f-c margin-r8">
							<view class="line2 f12-size">{{item.goodsName}}</view>
							<view v-if="item.goodsParamName" class="flex f-a-c margin-t6">
								<view class="flex  f-j-c padding-lr6 bg-color-f7 f11-size t-color-9 b-radius-2  h-20 line-h20 max-w120 line1">{{item.goodsParamName}}</view>
							</view>
						</view>
						<view class="flex f-s-0 f-c">
							<view class="text-price f12-size">{{item.buyPrice}}</view>
							<view class="flex f-j-e margin-t6 t-color-9 f11-size">x{{item.buyNum}}</view>
						</view>
					</view>
					<view v-if="order.remark != ''" class="flex f-j-s padding-tb6 f11-size">
						<text class="flex f-s-0">{{i18n['订单备注']}}</text>
						<text class="">{{order.remark}}</text>
					</view>


					<view class="btn-box"  v-if="order.status==9  && item.commentStatus!=2" >
									<button
										class="action-btn"
									   v-if="order.status==9  && item.commentStatus==0"
										@tap.stop="navToEvaluation(item)"
									>
										我要评价
									</button>
									<button
										class="action-btn"
										 v-if="item.commentStatus==1"
										@tap.stop="navToEvaluation(item, 'add')"
									>
										追加评价
									</button>
					</view>
			<!-- 	<view class="flex f-a-c f-j-e">
					<view v-if="state[order.refundStatus].value == 'wtk' && (orderState[order.status]['value'] == 'dfh' || orderState[order.status]['value'] == 'dsh' || (orderState[order.status]['value'] == 'ywc'&&order.refundExpiredTime >= now))"
					@click="refund(order)"
					class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f11-size b-color-e t-color-8 ">
					{{i18n['退款']}}
					</view>
					<view v-if="state[order.refundStatus].value != 'wtk'"  @click="go('/pages/ys/order/refunddetail?detailId='+order.id)"
					class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f11-size b-color-e t-color-8 ">
					{{i18n['退款详情']}}
					</view>
				</view> -->

				<view class="flex f-a-c f-j-e">
					<view v-if="state[item.refundStatus].value == 'wtk' && (orderState[order.status]['value'] == 'dfh' || orderState[order.status]['value'] == 'dsh' || (orderState[order.status]['value'] == 'ywc'&&order.refundExpiredTime >= now))"  @click="refund(item)" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f14-size b-color-e t-color-8 ">{{i18n['退款']}}</view>
					<view v-if="state[item.refundStatus].value != 'wtk'"  @click="go('/pages/user/refunddetail?detailId='+item.id)" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f11-size b-color-e t-color-8 ">{{i18n['退款详情']}}</view>
				</view>


					<view  class="writeOff borRadius14" v-if="order.verifyCode && order.shippingType==2">
						<view class="title">核销信息</view>
						<view class="grayBg">
							<view class="written"  v-if="order.shippingType == 2">
												<image src="./static/images/written.png"></image>
							</view>
							<view class="pictrue">
								<!-- <div class="qrcode" ref="qrcode"></div> -->
								<!-- <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}100%`, height: `${qrcodeSize}100%`}"/> -->
								<image :src="codeImg"></image>
							</view>
						</view>
						<view class="gear">
							<image src="./static/images/writeOff.jpg"></image>
						</view>
						<view class="num">{{item.verifyCode}}</view>
						<view class="rules">
							<view class="item" v-if="order.shipping_type == 2">
								<view class="rulesTitle acea-row row-middle">
									<text class="iconfont icon-shijian"></text>核销时间
								</view>
								<view class="info">
									每日:<text class="time">08:00-18:00</text>
								</view>
							</view>
							<view class="item">
								<view class="rulesTitle acea-row row-middle">
									<text class="iconfont icon-shuoming1"></text>使用说明
								</view>
								<view class="info">可将二维码出示给店员扫描或提供数字核销码</view>
							</view>
							<view class="item">
								<view class="rulesTitle acea-row row-middle">
									<text class="iconfont icon-shuoming1"></text>自提地址信息
								</view>
								<view class="map acea-row row-between-wrapper"  v-if="order.shippingType == 2">
												<view class='address'>
													<view class='name acea-row'  @tap="makePhone">
														<view class="nameCon">{{order.shopName}}</view>
													</view>
													<view   @tap="makePhone('800')"> <text class="iconfont icon-tonghua" style="margin-right:10rpx;"></text><text class='phone' >8004005555</text></view>
													<view   @tap="showMaoLocation(shopInfo)"><text class="iconfont icon-weizhi" style="margin-right:10rpx;"></text>查看位置</view>
												</view>
								</view>
								<view class='line' >
									<image src='@/static/images/line.jpg'></image>
								</view>
							</view>


						</view>
					</view>

				</view>

		<!-- 		<view class="btn-box" >
					<button
						class="action-btn"

						@tap.stop="navToEvaluation(order)"
					>
						我要评价
					</button>
					<button
						class="action-btn"
						@tap.stop="navToEvaluation(order, 'add')"
					>
						追加评价
					</button>
				</view> -->

			

				<view class="flex f-j-s padding-tb6 f12-size">
					<text>{{i18n['商品总价']}}</text>
					<text class="text-price">{{order.totalPrice | price}}</text>
				</view>
				<view class="flex f-j-s padding-tb6 f12-size">
					<text>{{i18n['运费']}}</text>
					<text v-if="order.freightFee" class="text-price">{{order.freightFee | price}}</text>
					<text v-else class="text-price">0</text>
				</view>
				<view class="flex f-j-s padding-tb6 f12-size">
					<text>{{i18n['优惠']}}</text>
					<text class="text-price">{{order.couponAmount}}</text>
				</view>
				<view class="flex f-j-e f12-size t-color-y f-w-500 margin-t6">
					<text>{{i18n['实付款']}}：</text>
					<text class="text-price">{{order.payPrice | price}}</text>
				</view>
			</view>
            <view v-if="order != ''" class="bg-color-w padding-12 b-radius-5 margin-b12 flex-col justify-between">
				<view class="f-w-b f15-size" :style="{'color': orderState[order.status]['color']}">{{orderState[order.status]['text']}}</view>

				<view class=" flex f-a-c">

					<uni-countdown class="margin-t6" v-if="orderState[order.status]['value'] == 'dhx' && autoGetGoods > 0"  color="#9B9B9B" splitorColor="#9B9B9B" :font-size="11" :second="autoGetGoods" />
					<uni-countdown class="margin-t6" v-if="orderState[order.status]['value'] == 'dzf' && cancelTime > 0"  color="#9B9B9B" splitorColor="#9B9B9B" :font-size="11" :second="cancelTime" />
				</view>
				<view class="flex f-j-e f-w ">

					<view v-if="order.status<4" @click.stop="cancelOrder()" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-l12 b-radius-30 f12-size  ">{{i18n['取消订单']}}</view>
					<view @click.stop="showWuliu()" v-if="order.status>=4" class="flex f-a-c f-j-c f-s-0 w-80 h-30  margin-l12 b-radius-30 f12-size b-color-3">{{i18n['查看物流']}}</view>
					<view @click.stop="showPay()" v-if="order.status==0" class="flex f-a-c f-j-c f-s-0 w-80 h-30  margin-l12 b-radius-30 f12-size bg-color-linear-y t-color-w">{{i18n['立即支付']}}</view>
					<view v-if="order.status>=4"  @click.stop="sureOrder()" class="flex f-a-c f-j-c f-s-0 w-80 h-30  margin-l12 b-radius-30 f12-size bg-color-linear-y t-color-w">{{i18n['确认收货']}}</view>
					<!--
					<view @click.stop="changeAddress()" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f12-size b-color-3 ">{{i18n['修改地址']}}</view>
					<view @click.stop="cancelOrder()" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f12-size b-color-3 ">{{i18n['取消订单']}}</view>
					<view @click.stop="showWuliu()"  class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f12-size b-color-3">{{i18n['查看物流']}}</view>
					<view @click.stop="showPay()"  class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f12-size bg-color-linear-y t-color-w">{{i18n['立即支付']}}</view>
					<view @click.stop="sureOrder()" class="flex f-a-c f-j-c f-s-0 w-80 h-30 margin-t12 margin-l12 b-radius-30 f12-size bg-color-linear-y t-color-w">{{i18n['确认收货']}}</view> -->


				</view>
			</view>
			<view class="bg-color-w b-radius-5 padding-12 margin-b12">
				<view class="flex f-j-s margin-b10">
					<view class="flex f-a-c ">
						<text class="f-w-500 t-color-3 margin-r4 ">{{i18n['订单详情']}}</text>
					</view>
				</view>
				<view class="flex f-a-c padding-tb6 f12-size">
					<text class="t-color-9 w-80">{{i18n['订单编号']}}：</text>
					<text class="">{{order.orderNo}}</text>
				</view>
				<view class="flex f-a-c padding-tb6 f12-size">
					<text class="t-color-9 w-80">{{i18n['支付交易号']}}：</text>
					<text class="">{{order.payOrderNo}}</text>
				</view>
				<view class="flex f-a-c padding-tb6 f12-size ">
					<text class="t-color-9 w-80">{{i18n['创建时间']}}：</text>
					<text class="">{{order.buyTime | time}}</text>
				</view>
				<view class="flex f-a-c padding-tb6 f12-size ">
					<text class="t-color-9 w-80">{{i18n['支付时间']}}：</text>
					<text class="">{{order.payTime | time}}</text>
				</view>
				<view v-if="order.deliveryTime" class="flex f-a-c padding-tb6 f12-size ">
					<text class="t-color-9 w-80">{{i18n['发货时间']}}：</text>
					<text class="">{{order.deliveryTime | time}}</text>
				</view>
				<view v-if="order.finishTime" class="flex f-a-c padding-tb6 f12-size ">
					<text class="t-color-9 w-80">{{i18n['完成时间']}}：</text>
					<text class="">{{order.finishTime | time}}</text>
				</view>
				<view class="b-bottom margin-t10"></view>
				<view @click="go('/pages/chat/chat?id='+shopMemberId+'&orderId='+order.id)" class="flex f-a-c f-j-c" style="padding-top: 10px;">
					<text class="flex f-a-c f-j-c van-icon van-icon-chat-o t-color-y margin-r4"></text>
					<text class="f12-size f-w-500">{{i18n['联系卖家']}}</text>
				</view>
				
			<!-- 	<view class="b-bottom margin-t10"></view>
				<view @click="go('/pages/chat/chat?id='+shopMemberId+'&orderId='+order.id)" class="flex f-a-c f-j-c" style="padding-top: 10px;">
					<text class="flex f-a-c f-j-c van-icon van-icon-chat-o t-color-y margin-r4"></text>
					<text class="f12-size f-w-500">申请开票</text>
				</view> -->
			</view>
		</view>




		<!-- 底部 -->
			<!--

			<view class="footer">

				<button
					class="action-btn"

				>
					删除订单
				</button>
				 <button
					class="action-btn"
					:class="'bg-' + themeColor.name"
					v-if="orderDetail.order_status == -4"
					@tap="handleOrderOperation(orderDetail, 'delete')"
				>
					删除订单
				</button>
				<button
					class="action-btn"
					:class="'text-' + themeColor.name"
					v-if="orderDetail.order_status == 0"
					@tap="handleOrderOperation(orderDetail, 'close')"
				>
					取消订单
				</button>
				<button
					class="action-btn"
					:class="'bg-' + themeColor.name"
					v-if="orderDetail.order_status == 0"
					@tap="navTo(`/money/pay?id=${orderDetail.id}`)"
				>
					立即支付
				</button>
				<button
					class="action-btn"
					:class="'text-' + themeColor.name"

					@tap="handleOrderOperation(orderDetail, 'shipping')"
				>
					查看物流
				</button>
				<navigator url="/pages/set/invoice/invoice?source=1">
					<button
						v-if="orderDetail.pay_money > 0 && !orderDetail.invoice"
						class="action-btn"
						:class="'bg-' + themeColor.name"
					>
						申请开票
					</button>
				</navigator>
				<button
					class="action-btn"
					:class="'bg-' + themeColor.name"
					v-if="
						(orderDetail.order_status == 3 || orderDetail.order_status == 4) &&
							orderDetail.is_evaluate == 0
					"
					@tap="handleOrderOperation(orderDetail, 'evaluation')"
				>
					批量评价
				</button>
				<button
					class="action-btn"
					:class="'bg-' + themeColor.name"
					v-if="orderDetail.order_status == 2"
					@tap="handleOrderOperation(orderDetail, 'delivery')"
				>
					确认收货
				</button>
			</view>
	-->



		<logistics ref="wuliuinfo"></logistics>
		<pay-item ref="payitem" @pay='pay' pageType="2"></pay-item>
		<notice ></notice>
	</view>
</template>
<style scoped>
@import url('../../static/css/iconcolor.css');
</style>
<style>

.order-details .writeOff {
		background-color: #fff;
		margin-top: 13rpx;
		padding-bottom: 30rpx;
	}

	.order-details .writeOff .title {
		font-size: 30rpx;
		color: #282828;
		height: 87rpx;
		border-bottom: 1px solid #f0f0f0;
		padding: 0 30rpx;
		line-height: 87rpx;
	}

	.order-details .writeOff .grayBg {
		background-color: #f2f5f7;
		width: 590rpx;
		height: 384rpx;
		border-radius: 20rpx 20rpx 0 0;
		margin: 50rpx auto 0 auto;
		padding-top: 55rpx;
		position: relative;
	}


	.order-details .writeOff .grayBg .written {
		position: absolute;
		top: 0;
		right: 0;
		width: 60rpx;
		height: 60rpx;
	}

	.order-details .writeOff .grayBg .written image {
		width: 100%;
		height: 100%;
	}

	.order-details .writeOff .grayBg .pictrue {
		width: 290rpx;
		height: 290rpx;
		margin: 0 auto;
	}

	.order-details .writeOff .grayBg .pictrue image {
		width: 100%;
		height: 100%;
		display: block;
	}


	.order-details .writeOff .gear {
		width: 590rpx;
		height: 30rpx;
		margin: 0 auto;
	}

	.order-details .writeOff .gear image {
		width: 100%;
		height: 100%;
		display: block;
	}

	.order-details .writeOff .num {
		background-color: #f0c34c;
		width: 590rpx;
		height: 84rpx;
		color: #282828;
		font-size: 48rpx;
		margin: 0 auto;
		border-radius: 0 0 20rpx 20rpx;
		text-align: center;
		padding-top: 4rpx;
	}

	.order-details .writeOff .rules {
		margin: 46rpx 30rpx 0 30rpx;
		border-top: 1px solid #f0f0f0;
		padding-top: 10rpx;
	}

	.order-details .writeOff .rules .item {
		margin-top: 20rpx;
	}

	.order-details .writeOff .rules .item .rulesTitle {
		font-size: 28rpx;
		color: #282828;
	}

	.order-details .writeOff .rules .item .rulesTitle .iconfont {
		font-size: 30rpx;
		color: #333;
		margin-right: 8rpx;
		margin-top: 5rpx;
	}

	.order-details .writeOff .rules .item .info {
		font-size: 28rpx;
		color: #999;
		margin-top: 7rpx;
	}

	.order-details .writeOff .rules .item .info .time {
		margin-left: 20rpx;
	}

	.order-details .map {
		font-size: 30rpx;
		color: #282828;
		margin-top: 15rpx;
		background-color: #fff;
		padding: 0 15rpx;

		.title {
			line-height: 86rpx;
			border-bottom: 1px solid #f0f0f0;
		}
	}

	.order-details .map .place {
		font-size: 26rpx;
		width: 176rpx;
		height: 50rpx;
		border-radius: 25rpx;
		line-height: 50rpx;
		text-align: center;
	}

	.order-details .map .place .iconfont {
		font-size: 27rpx;
		height: 27rpx;
		line-height: 27rpx;
		margin: 2rpx 3rpx 0 0;
	}


	.order-details .address {
		font-size: 26rpx;
		color: #868686;
		background-color: #fff;
		margin-top: 10rpx;
		padding: 0;
	}

	.order-details .address .name {
		font-size: 30rpx;
		color: #282828;
		margin-bottom: 15rpx;
	}

	.order-details .address .name .nameCon{
		max-width: 410rpx;
	}

	.order-details .address .name .phone {
		margin-left: 40rpx;
	}
	.refund {
		padding: 0 !important;
		margin-top: 15rpx;
		background-color: #fff;

		.title {
			display: flex;
			align-items: center;
			font-size: 30rpx;
			color: #333;
			height: 86rpx;
			border-bottom: 1px solid #f5f5f5;
			font-weight: 400;
			padding: 0 24rpx;

			image {
				width: 32rpx;
				height: 32rpx;
				margin-right: 10rpx;
			}
		}

		.con {
			font-size: 26rpx;
			color: #666666;
			padding: 30rpx 24rpx;
		}
	}

	.userRemark {
		width: 76%;
		display: inline-block;
	}

	.cor-86 {
		color: #868686;
		text-align: right;
	}
	</style>
<script>
	import payItem from '@/components/common/payitem';
	import logistics from '@/components/common/logistics.vue';
	const state = require('@/utils/api/state.js').default;
	const API = require('@/utils/api/order.js').default;
	const $ = require('@/utils/api.js');
	let self;
	export default {
		data() {
			return {
				id: '',
				goodsList: [],
				order: '',
				groupJoinList: [],
				state: state.refundStatus,
				orderState: state.orderStatus,
				shopMemberId: '',
				now: 0,
				autoGetGoods: 0,
				cancelTime: 0,
				group: '',
				codeImg:'',
			};
		},
		onLoad: function(options) {
			self = this;
			this.id = options.id ? options.id : '';
			$.setTitle(self.i18n['订单详情']);
		},
		onShow() {
			this.init();
		},
		methods: {


						navToEvaluation(item, type) {
							this.$mRouter.push({
								route: `/pages/comment/comment?detailId=`+item.id+`&add=`+type
							});



						},

					     /**
						 *
						 * 生成二维码
						 */
						markCode(text) {
							this.$http
								.post( API.strToBase64Api, {
									height: '145',
									text: text,
									width: '145'
							    })
								.then(r => {
									 this.codeImg= r.data.code
								})
								.catch(() => {

								});

						},
						/**
						 *
						 * 剪切订单号
						 */
						// #ifndef H5
						copy: function() {
							let that = this;
							uni.setClipboardData({
								data: this.orderInfo.orderNo
							});
						},
						// #endif

				      //查看内置地图
						goMap(item) {
							let that = this;
							//#ifdef H5
							if (that.$wechat.isWeixin() === true) {
								that.$wechat.seeLocation({
									latitude: parseFloat(this.merchantOrderVoList[this.activeIndex].latitude),
									longitude: parseFloat(this.merchantOrderVoList[this.activeIndex].longitude),
									name: item.merName,
									address: item.addressDetail ? item.addressDetail : '',
								}).then(res => {
									console.log('success');
								})
							} else {
								//#endif
								uni.openLocation({
									latitude: parseFloat(this.merchantOrderVoList[this.activeIndex].latitude),
									longitude: parseFloat(this.merchantOrderVoList[this.activeIndex].longitude),
									scale: 8,
									name: item.merName,
									address: item.addressDetail ? item.addressDetail : '',
									success: function(res) {
										that.go_map = true
									},
								});
								// #ifdef H5
							}
							//#endif
						},

							/**
							 * 打电话
							 */
							goTel: function() {
								uni.makePhoneCall({
									phoneNumber: this.orderInfo.deliveryId
								})
							},

							makePhone: function(e) {
								uni.makePhoneCall({
									phoneNumber: e
								})
							},
							/**
							 * 打开地图
							 *
							 */
							showMaoLocation: function(e) {
								if (!e.merLatitude || !e.merLongitude){
									uni.showToast({
										title: '缺少经纬度信息无法查看地图',
										icon: 'none'
									})
									return
								}
								//#ifdef H5
								if (this.$wechat.isWeixin() === true) {
									this.$wechat.seeLocation({
										latitude: parseFloat(e.merLatitude),
										longitude: parseFloat(e.merLongitude),
										name: e.merName,
										address: e.merAddressDetail,
									}).then(res => {
										console.log('success');
									})
								} else {
									//#endif
									uni.openLocation({
										latitude: parseFloat(e.merLatitude),
										longitude: parseFloat(e.merLongitude),
										scale: 8,
										name: e.merName,
										address: e.merAddressDetail,
										success: function() {

										},
									});
									// #ifdef H5
								}
								//#endif

							},
			showPay(index) {


				// $.go("/pages/order/pay?orderNo=170767604994310000061&amount=0.01")

				$.go("/pages/order/pay?orderNo="+self.order.payOrderNo+"&amount="+self.order.payPrice)
				// $.go("/pages/order/pay?orderNo="+self.order.orderNo+"&amount="+self.order.payPrice)


				// this.payIndex = index;
				// this.$refs.payitem.open();
			},


			async pay(type) {


				let  order_group = "order"
				let  params  = {
					orderNo: self.orderNo,
					payMethod: type
				}



				// switch (parseInt(this.payType, 10)) {
				switch (self.$refs.payitem.type) {
					case 'wxPay': // 微信支付
						await this.$mPayment.weixinPay(order_group,  {	orderNo: self.order.payOrderNo,payMethod: type}, '/pages/user/account/account', this.code);
						break;
					case 'aliPay': // 支付宝支付
						await this.$mPayment.aliPay(order_group, {	orderNo: self.order.payOrderNo,payMethod: type}, '/pages/user/account/account');
						break;
					case "balance":
						await this.$mPayment.balancePay(order_group, {orderNo: self.order.payOrderNo,payMethod: type},route);
						break;
					default:
						break;
				}
			},


			// pay(type) {
			// 	$.ajax({
			// 		url: API.payOrderApi,
			// 		data: {
			// 			payOrderNo: self.order.payOrderNo,
			// 			payMethod: type
			// 		},
			// 		method: 'POST',
			// 		success(res) {
			// 			if (type != 'balance') {
			// 				// #ifndef H5
			// 				$.wxPay({
			// 					payType: type.toLocaleLowerCase(),
			// 					data: res.data.message,
			// 					success(res) {
			// 						self.order['status'] = 1;
			// 					}
			// 				})
			// 				// #endif
			// 				// #ifdef H5
			// 				$.wxPayH5({
			// 					data: res.data.message,
			// 					success(res) {
			// 						self.order['status'] = 1;
			// 					}
			// 				})
			// 				// #endif
			// 			}
			// 			if (type == 'balance') {
			// 				self.order['status'] = 1;
			// 			}
			// 		}
			// 	})
			// },
			showWuliu() {
				this.$refs.wuliuinfo.show(this.order.id);
			},
			sureOrder() {
				$.ajax({
					url: API.sureOrderApi,
					data: {
						orderId: self.order.id
					},
					method: 'POST',
					success(res) {
						$.$toast(self.i18n['操作成功']);
						self.order.status = 3;
					}
				})
			},
			cancelOrder() {
				$.showModal({
					content: '是否确认删除',
					success() {
						let info = self.order;
						$.ajax({
							url: API.cancelOrderApi,
							data: {
								orderId: info.id
							},
							method: 'POST',
							success(res) {
								$.$toast(self.i18n['操作成功']);
								self.order.status = 4;
							}
						})
					},
				},this)

			},
			changeAddress() {
				let info = self.order;
				self.go('/pages/user/address?id='+info.id+'&type=change');
			},
			refund(data) {
				//与评价共用一个缓存
				uni.setStorageSync('comment',data);
				self.go('/pages/user/refund');
			},
			getDetail() {
				$.ajax({
					url: API.orderDetailApi,
					data: {
						orderId: self.id
					},
					method: 'GET',
					success(res) {
						let info = res.data ? res.data : '';
						if(info == ''){return}
						self.goodsList = info.orderDetailList ? info.orderDetailList : [];
						self.groupJoinList = info.groupMemberList ? info.groupMemberList : [];
						self.order = info.order ? info.order : '';
						self.group = info.orderGroup ? info.orderGroup : '';
						self.shopMemberId = info.shopMemberId ? info.shopMemberId : '';
						self.now = res.now;



						console.log(res)
						if(self.order.finishExpiredTime) {//自动确认收货时间
							self.autoGetGoods = Number(self.order.finishExpiredTime - res.now)/1000;
						}
						if(self.order.payEndTime) {//超过这个时间未支付订单取消
							self.cancelTime = Number(self.order.payEndTime - res.now)/1000;
						}


						console.log("self.goodsList",self.goodsList)
						self.goodsList.forEach(function(item, index, array) {

							// item 是arr1数组中的每一项
							// index 是arr1数组的索引值，Number类型

											console.log("self.item.verifyCode",item.verifyCode)
											if(item.verifyCode  &&  item.shippingType==2){
												     item.qrcode =self.markCode(item.verifyCode);
											}

						})
						// self.goodsList.forEach(function(item, index, array) {
						// 	// 这个函数内的this指向arr2
						// 	// item 是arr1数组中的每一项
						// 	// index 是arr1数组的索引值，Number类型
						// }, arr2)





					}
				})
			},
			init() {
				this.getDetail();
			},
		},
		created() {
		},
		computed: {
			i18n() {
				return this.$t('orderlist')
			},
		},
		mounted() {},
		destroyed() {},
		components: {logistics,payItem},
		onPullDownRefresh() {
		},
		onReachBottom() {
		}
	}
</script>

<style>

		.order-details .writeOff {
			background-color: #fff;
			margin-top: 15rpx;
			padding-bottom: 50rpx;
		}

		.order-details .writeOff .title {
			font-size: 30rpx;
			color: #282828;
			height: 87rpx;
			border-bottom: 1px solid #f0f0f0;
			padding: 0 24rpx;
			line-height: 87rpx;
		}

		.order-details .writeOff .grayBg {
			background-color: #f2f5f7;
			width: 590rpx;
			height: 384rpx;
			border-radius: 20rpx 20rpx 0 0;
			margin: 50rpx auto 0 auto;
			padding-top: 55rpx;
		}

		.order-details .writeOff .grayBg .pictrue {
			width: 290rpx;
			height: 290rpx;
			margin: 0 auto;
		}

		.order-details .writeOff .grayBg .pictrue image {
			width: 100%;
			height: 100%;
			display: block;
		}

		.order-details .writeOff .gear {
			width: 590rpx;
			height: 30rpx;
			margin: 0 auto;
		}

		.order-details .writeOff .gear image {
			width: 100%;
			height: 100%;
			display: block;
		}

		.order-details .writeOff .num {
			background-color: #f0c34c;
			width: 590rpx;
			height: 84rpx;
			color: #282828;
			font-size: 48rpx;
			margin: 0 auto;
			border-radius: 0 0 20rpx 20rpx;
			text-align: center;
			padding-top: 4rpx;
		}

		.order-details .writeOff .rules {
			margin: 46rpx 30rpx 0 30rpx;
			border-top: 1px solid #f0f0f0;
			padding-top: 10rpx;
		}

		.order-details .writeOff .rules .item {
			margin-top: 20rpx;
		}

		.order-details .writeOff .rules .item .rulesTitle {
			font-size: 28rpx;
			color: #282828;
		}

		.order-details .writeOff .rules .item .rulesTitle .iconfont {
			font-size: 30rpx;
			color: #333;
			margin-right: 8rpx;
			margin-top: 5rpx;
		}

		.order-details .writeOff .rules .item .info {
			font-size: 28rpx;
			color: #999;
			margin-top: 7rpx;
		}

		.order-details .writeOff .rules .item .info .time {
			margin-left: 20rpx;
		}

		.order-details .map {
			font-size: 30rpx;
			color: #282828;
			margin-top: 15rpx;
			background-color: #fff;
			padding: 0 24rpx;

			.title {
				line-height: 86rpx;
				border-bottom: 1px solid #f0f0f0;
			}
		}

		.order-details .map .place {
			font-size: 26rpx;
			width: 176rpx;
			height: 50rpx;
			border-radius: 25rpx;
			line-height: 50rpx;
			text-align: center;
		}

		.order-details .map .place .iconfont {
			font-size: 27rpx;
			height: 27rpx;
			line-height: 27rpx;
			margin: 2rpx 3rpx 0 0;
		}

		.order-details .address .name .iconfont {
			font-size: 34rpx;
			margin-left: 10rpx;
		}

		.refund {
			padding: 0 !important;
			margin-top: 15rpx;
			background-color: #fff;

			.title {
				display: flex;
				align-items: center;
				font-size: 30rpx;
				color: #333;
				height: 86rpx;
				border-bottom: 1px solid #f5f5f5;
				font-weight: 400;
				padding: 0 24rpx;

				image {
					width: 32rpx;
					height: 32rpx;
					margin-right: 10rpx;
				}
			}

			.con {
				font-size: 26rpx;
				color: #666666;
				padding: 30rpx 24rpx;
			}
		}

		.userRemark {
			width: 76%;
			display: inline-block;
		}

		.cor-86 {
			color: #868686;
			text-align: right;
		}

		.btn-box {
			display: flex;
			justify-content: flex-end;
			align-items: center;
			margin: 10px 0;
		}
		.action-btn{
		    font-size: 12px;
		    margin: 0 0 0 7px;
		    padding: 0 14px;
		    color: #606266;
		    text-align: center;
		    height: 26px;
		    border-radius: 16px;
		    line-height: 26px;
		    border: 0.5px solid rgba(0, 0, 0, 0.15);
		}



.footer {
	position: fixed;
	left: 0;
	bottom: 0;
	z-index: 98;
	width: 100%;

	color: $font-color-base;
	box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 30rpx 20rpx;
	.action-btn {
			/* background-color:#fa436a; */
		font-size: $font-sm;
		margin: 0 0 0 15upx;
		padding: 0 $spacing-lg;
		text-align: center;
		height: 60upx;
		line-height: 60upx;
	}
}
.rf-no-data {
	height: calc(100vh - 90upx);
}
.pickup-tag {
	margin-right: $spacing-sm;
}

	</style>
